<?php

namespace app\admin\validate;

use think\Validate;

class UserGroup extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'name' => 'require|max:50|unique:user_group',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'name.max'  => '组名长度不能超过50字符',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
    ];
    public function __construct(array $rules = [], $message = [], $field = [])
    {
        $this->field = [
            'name' => __('Name'),
        ];
    }
}
